
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>sctiks_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>sctiks_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void sctiks_c ( SpiceInt           sc, 
                   ConstSpiceChar   * clkstr, 
                   SpiceDouble      * ticks   ) 
</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
 
   Convert a spacecraft clock format string to number of &quot;ticks&quot;. 
 </PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
 
   <a href="../req/sclk.html">SCLK</a> 
 </PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
 
   CONVERSION 
   TIME 
 

</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
 
   Variable  I/O  Description 
   --------  ---  -------------------------------------------------- 
   sc         I   NAIF spacecraft identification code. 
   clkstr     I   Character representation of a spacecraft clock. 
   ticks      O   Number of ticks represented by the clock string. 
 </PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
 
   sc         is the NAIF ID number for the spacecraft whose clock 
              string is being converted. 
 
   clkstr     is a character string representing a spacecraft clock 
              time, WITHOUT PARTITION NUMBER. 
 
              Using Galileo as an example, the full format is 
 
                 wwwwwwww:xx:y:z 
 
              where z is a mod-8 counter (values 0-7) which 
              increments approximately once every 8 1/3 ms., y is a 
              mod-10 counter (values 0-9) which increments once 
              every time z turns over, i.e., approximately once every 
              66 2/3 ms., xx is a mod-91 (values 0-90) counter 
              which increments once every time y turns over, i.e., 
              once every 2/3 seconds. wwwwwwww is the Real-Time Image 
              Count (RIM), which increments once every time xx turns 
              over, i.e., once every 60 2/3 seconds. The roll-over 
              expression for the RIM is 16777215, which corresponds 
              to approximately 32 years. 
 
              wwwwwwww, xx, y, and z are referred to interchangeably 
              as the fields or components of the spacecraft clock. 
              SCLK components may be separated by any of the 
              following characters: &quot; &quot;  &quot;.&quot;  &quot;:&quot;  &quot;,&quot;  &quot;-&quot; 
              Any number of spaces may separate the components and 
              the delimiters. The presence of the RIM component 
              is required. Successive components may be omitted, and 
              in such cases are assumed to represent zero values. 
 
              Values for the individual components may exceed the 
              maximum expected values. For instance, &quot;0:0:0:9&quot; is 
              an acceptable Galileo clock string, and will convert 
              to the same number of ticks as &quot;0:0:1:1&quot;. 
 
              Consecutive delimiters containing no intervening digits 
              are treated as if they delimit zero components. 
 
              Trailing zeros should always be included to match the 
              length of the counter.  For example, a Galileo clock 
              count of &quot;25684.90&quot; should not be represented as 
              &quot;25684.9&quot;. 
 
              Some spacecraft clock components have offset, or 
              starting, values different from zero.  For example, 
              with an offset value of 1, a mod 20 counter would 
              cycle from 1 to 20 instead of from 0 to 19. 
 
              See the SCLK required reading for a detailed 
              description of the Voyager and Mars Observer clock 
              formats. 
 
 </PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
 
   ticks      is the number of ticks represented by the spacecraft 
              clock string. A tick is defined to be the smallest 
              time increment expressible by the spacecraft clock. 
 
              An analogy may be drawn between a spacecraft clock 
              and a standard wall clock, measuring hours, minutes 
              and seconds. The number of ticks represented by the 
              wall clock string 
                                 
                 hh:mm:ss 
 
              would be the number of seconds represented by that 
              time. 
 
              For example: 
 
                 00:00:10  would convert to 10 
                 00:01:00  would convert to 60 
                 00:10:00  would convert to 600 
                 01:00:00  would convert to 3600 
                 01:01:00  would convert to 3660 
 
              See the Examples section below for examples for 
              actual spacecraft clocks. 
 </PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
 
   1)  If the spacecraft clock type is not supported then the 
       error SPICE(NOTSUPPORTED) is signalled. 
 
   2)  If any of the extracted clock components cannot be parsed as 
       integers, or the string has too many components, or the value 
       of one of the components is less than the offset value, then 
       the error is diagnosed by routines called by this routine. 
 
   3)  Invalid spacecraft ID's are not diagnosed. 
 </PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
 
   Note the important difference between <a href="scencd_c.html">scencd_c</a> and <b>sctiks_c</b>. <a href="scencd_c.html">scencd_c</a> 
   converts a clock string to the number of ticks it represents 
   since the beginning of the mission, and so uses partition 
   information. <b>sctiks_c</b> just converts to absolute ticks. 
 </PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
 
   <b>sctiks_c</b> is used as part of the process of encoding spacecraft clock 
   by <a href="scencd_c.html">scencd_c</a>, though <b>sctiks_c</b> does not process any partition informa- 
   tion. 
 
   Another use of <b>sctiks_c</b>, however, is to convert a clock measurement 
   to ticks for use as a tolerance for the CK reader <a href="ckgp_c.html">ckgp_c</a>. 
 
 
      /.
      Get the pointing from a CK file of the VGR 1 narrow angle 
      image corresponding to a particular SCLK count. 
 
      Load the CK file and the kernel file containing SCLK 
      partition information for <a href="scencd_c.html">scencd_c</a>. 
      ./
      <a href="cklpf_c.html">cklpf_c</a>  ( &quot;vgr1na.ck&quot;, &amp;handle ); 
      <a href="furnsh_c.html">furnsh_c</a> ( &quot;sclk.ker&quot;           ); 
 
      /.
      Get the right ID numbers. 
      ./
      sc    = -31; 
      instr = -31001; 
 
      /.
      The SCLK string includes a partition number. Pictures are 
      never shuttered at intervals smaller than 1 MOD60 count 
      from each other. So use 1 MOD60 count as the time 
      tolerance. 
      ./
      clkstr = &quot;1/20556:14:768&quot;; 
      tolstr = &quot;      0:01:000&quot;; 

      /.
      Encode the clock string and the tolerance. 
      ./
      <a href="scencd_c.html">scencd_c</a> ( sc, clkstr, &amp;sclk ); 
      <b>sctiks_c</b> ( sc, tolstr, &amp;tol  ); 
 
      /.
      Get the pointing from the C-kernel. 
      ./
      <a href="ckgp_c.html">ckgp_c</a> ( instr, sclk, tol, ref, cmat, &amp;clkout, &amp;found ); 
 
 
 
    Below are some examples illustrating various clock string inputs 
    and the resulting outputs for the Galileo spacecraft. See the 
    SCLK required reading for a detailed description of the Galileo 
    clock format. 
 
       CLKSTR                TICKS 
       ----------------      -------------------- 
       &quot;0:0:0:1&quot;             1 
       &quot;0:0:1&quot;               8 
       &quot;0:1&quot;                 80 
       &quot;1&quot;                   7280 
       &quot;1 0 0 0&quot;             7280 
       &quot;1,0,0,0&quot;             7280 
       &quot;1:90&quot;                14480 
       &quot;1:9&quot;                 8000 
       &quot;1:09&quot;                8000 
       &quot;0-0-10&quot;              80   |--  Third component is supposed 
       &quot;0-1-0&quot;               80   |    to be a mod-10 count. 
       &quot;0/1/0&quot;               Error: &quot;/&quot; is not an accepted delimiter. 
       &quot;1: 00 : 0 : 1&quot;       7281 
       &quot;1:::1&quot;               7281 
       &quot;1.1.1.1.1&quot;           Error: Too many components 
       &quot;1.1.1.1.&quot;            Error: The last delimiter signals that 
                                    a fifth component will follow. 
 
 
       The following examples are for the Voyager 2 spacecraft. Note 
       that the last component of the Voyager clock has an offset 
       value of 1. 
 
       CLKSTR                TICKS 
       ----------------      -------------------- 
        &quot;0.0.001&quot;              0 
        &quot;0:0:002&quot;              1 
        &quot;0:01&quot;                 800 
        &quot;1&quot;                    48000 
        &quot;1.0&quot;                  48000 
        &quot;1.0.0&quot;                Error: The 3rd component is never 0. 
        &quot;0.0:100&quot;              99 
        &quot;0-60-1&quot;               48000 
        &quot;1-1-1&quot;                48800 
        &quot;1-1-2&quot;                48801 
 
 </PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
 
   J.M. Lynch     (JPL) 
   R.E. Thurman   (JPL) 
 </PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
   -CSPICE Version 1.1.1, 14-AUG-2006   (EDW)

      Replace mention of <a href="ldpool_c.html">ldpool_c</a> with <a href="furnsh_c.html">furnsh_c</a>.

   -CSPICE Version 1.1.0, 08-FEB-1998 (NJB)  
   
       References to C2F_CreateStr_Sig were removed; code was
       cleaned up accordingly.  String checks are now done using
       the macro CHKFSTR.
       
   -CSPICE Version 1.0.0, 25-OCT-1997 (NJB)
   
      Based on SPICELIB Version 1.0.1, 10-MAR-1992 (WLT)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
 
   convert spacecraft_clock string to ticks 
 </PRE>
<h4>Link to routine sctiks_c source file <a href='../../../src/cspice/sctiks_c.c'>sctiks_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:29 2010</pre>

</body>
</html>

